#ifndef INITRECORDERTASK_H
#define INITRECORDERTASK_H

#include "libs/base/task/task.h"
#include <QPointer>

class CaptchaAssistDialog;
class LiveRecorder;

class InitRecorderTask : public yc::Task
{
    Q_OBJECT
public:
    explicit InitRecorderTask(LiveRecorder* recorder, QObject* parent = nullptr);

private:
    void startImpl() override;
    void terminateImpl() override;
    void startNext();
    void showToast();

    LiveRecorder* recorder_;
    int success_count_ = 0;
    int pos_ = 0;
    bool captcha_shown_ = false;
    int reload_count_ = 0;
    QTimer* reload_timer_ = nullptr;
    QPointer<CaptchaAssistDialog> dialog_;
};

#endif // INITRECORDERTASK_H
